<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/view/common/includes.jsp" %>
<%@ include file="/WEB-INF/view/inc.jsp" %>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

<div class="dialog_form">
    <form  method="post" id="fm" action="<%=contextPath%>/cookbook/saveAndUpdate" enctype="multipart/form-data"accept="image/gif, image/jpeg,image/jpg, image/png">
        <input type="hidden" name="id" value="${cookbook.id}"/>
        <input type="hidden" id="imgs" value="${cookbook.img}"/> <!--图片回显-->

        <div class="dialog_item">
            <label>菜谱名称:</label>
            <input  name="cookbookName" class="no-space easyui-textbox" required="true"  style="width:300px;"
                    validType="length[1,50]" value="${cookbook.cookbookName}">
        </div>
        <div class="dialog_item">
            <label>点评:</label>
            <input name="comments" class="easyui-textbox" data-options="multiline:true" validType="length[1,1000]" style="width:300px;height:60px" value="${cookbook.comments}">
        </div>
        <div class="dialog_item">
            <label>美味体验:</label>
            <input name="experience" class="easyui-textbox" data-options="multiline:true" validType="length[1,1000]" style="width:300px;height:60px" value="${cookbook.experience}">
        </div>
        <div class="dialog_item">
            <label>养生必读:</label>
            <input name="health" class="easyui-textbox" data-options="multiline:true" validType="length[1,1000]" style="width:300px;height:60px" value="${cookbook.health}">
        </div>
        <div class="dialog_item">
            <label>状态:</label>
            <input name="sex" editable="false" value="${cookbook.status}" style="width:300px;"
                   class="easyui-combobox" data-options="valueField : 'code',
	    						textField : 'name', url:'<%=contextPath%>/sys/codeItems/byCategoryCode?categoryCode=status',
								panelHeight:'auto'
							">
        </div>
        <br/>
        <div class="dialog_item">
        <label id="title">图片预览:</label>
        <div id="tpyl"> <!--图片回显框-->
            <ul>
                <li>
                    <div>
                    <img class="uploadImgButton" src="/jslib/common/images/button/add.jpg" style="width: 90px;margin-top: 10px;margin-left: 10px;" onclick="loadImg()">
                    </div>
                </li>
            </ul>
        </div>
        </div>
        <div class="dialog_item">
            <%--图片上传--%>
            <input  name="fileToUpload" id="fileToUpload" type="file" multiple="true" onchange="sy_uploadImg()" <%--class="easyui-filebox"--%>  validType="length[1,1000]" style="display: none" value="${cookbook.img}">
        </div>
    </form>
</div>
<script>
    /** 图片回显加载
    *
     */
    $(function(){
        var imgs = $("#imgs").val();
        var imgtDiv = $("#tpyl ul");
        if(imgs!=undefined && imgs!=""){
            inserImg(imgs,imgtDiv);
        }
        loadMouseEventFun();
    })
</script>
</body>
</html>
